<?php

use think\facade\Route;
use app\adminapi\middleware\JwtAuth;
use app\adminapi\middleware\OperateLog;

// 文章路由
Route::group('article', function () {
    Route::get('index', 'cms.Article/index')->name('article:list')->setOption('real_name', '获取文章列表');
    Route::get('read/:id', 'cms.Article/read')->name('article:detail')->setOption('real_name', '获取文章详情');
    Route::post('save', 'cms.Article/save')->name('article:add')->setOption('real_name', '添加文章');
    Route::put('update/:id', 'cms.Article/update')->name('article:update')->setOption('real_name', '编辑文章');
    Route::delete('delete/:id', 'cms.Article/delete')->name('article:delete')->setOption('real_name', '删除文章');
})->middleware([JwtAuth::class, OperateLog::class]);

// 文章分类路由
Route::group('article_cate', function () {
    Route::get('index', 'cms.ArticleCate/index')->name('article_cate:list')->setOption('real_name', '获取文章分类列表');
    Route::get('read/:id', 'cms.ArticleCate/read')->name('article_cate:detail')->setOption('real_name', '获取文章分类详情');
    Route::post('save', 'cms.ArticleCate/save')->name('article_cate:add')->setOption('real_name', '添加文章分类');
    Route::put('update/:id', 'cms.ArticleCate/update')->name('article_cate:update')->setOption('real_name', '编辑文章分类');
    Route::delete('delete/:id', 'cms.ArticleCate/delete')->name('article_cate:delete')->setOption('real_name', '删除文章分类');
})->middleware([JwtAuth::class, OperateLog::class]);